package zjl.base;

import java.util.ArrayList;
import java.util.List;

public class SchedTable {

    private NodeBase belongNode;

    private List<SchedEntry> entries;

    public SchedTable(NodeBase node) {
        this.belongNode = node;
        this.entries = new ArrayList<>();
    }

    public void insertSchedEntry(SchedEntry entry) {
        this.entries.add(entry);
    }

    @Override
    public String toString() {
        String str = "SCHED_TABLE FOR NODE " + this.belongNode.getName() + ": {";
        for (SchedEntry entry : entries)
            str += "\n  " + entry;
        str += "\n}";

        return str;
    }
}
